﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace KasaTakip
{
    public partial class frmFiltre : DevExpress.XtraEditors.XtraForm
    {
        private bool _tarih2Goster = false;
        public Boolean TarihGoster { get { return _tarih2Goster; } set { _tarih2Goster = value; } }
        public Rapor Sonuc { get; set; }

        public frmFiltre()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            Rapor rpr = new Rapor();
            rpr.Tarih1 = dateEdit1.DateTime;
            rpr.Tarih2 = dateEdit2.DateTime;
            this.Sonuc = rpr;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void frmFiltre_Load(object sender, EventArgs e)
        {
            dateEdit1.DateTime = DateTime.Now.AddDays(-1);
            dateEdit2.DateTime = DateTime.Now;
            if (!_tarih2Goster)
            {
                labelControl1.Text = "Tarih";
                labelControl2.Visible = false;
                dateEdit2.Visible = false;
            }
            else
            {
                labelControl1.Text = "Başlangıç Tarihi";
                labelControl1.Text = "Bitiş Tarihi";
            }
        }
    }
}